using UnityEngine;

public class SmoothFollow : MonoBehaviour
{
	public float followSpeedX = 2f;

	public float followSpeedY = 2f;

	public float depth = -10f;

	public Transform targetTransform;

	public float offsetX;

	public float offsetY;

	private void Update()
	{
		if ((bool)targetTransform)
		{
			Vector3 position = targetTransform.position;
			position.x += offsetX;
			position.y += offsetY;
			position.z = depth;
			Vector3 vector = Vector3.Slerp(base.transform.position, position, followSpeedX * Time.deltaTime);
			Vector3 vector2 = Vector3.Slerp(base.transform.position, position, followSpeedY * Time.deltaTime);
			position.z = depth;
			position.x = vector.x;
			position.y = vector2.y;
			base.transform.position = position;
		}
	}
}
